import RPi.GPIO as GPIO
import control_car.CarControl as CarControl

class IrRecv():
    def __init__(self):
        self.IN_ = 1
        GPIO.setmode(GPIO.BOARD)
        self.setup(self.IN_, GPIO.IN)
        self.car_ = CarControl()
        
    def Run(self):
        try:
            while True:
                d = GPIO.input(self.IN_)
                
                if d == 1:
                    print d
                elif d == 2:
                    print d
                else:
                    self.car_.MoveOn()
                
        except:
            GPIO.cleanup()     
            
if __name__ == "__main__":
    ir = IrRecv()
    ir.Run()
    